<!--添加商品信息-->
<div class="dialog_content">
<form id="info_form" action="{:U('Order/add')}" method="post">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">

    <tr>
      <th width="80">商品名称:</th>
      <td><input type="text" name="goods_name" id="goods_name" class="input-text" ></td>
    </tr>
    <tr>
      <th>购买数量 :</th>
      <td><input type="text" name="goods_count" id="goods_count" class="input-text" value="1">盒</td>
    </tr>
    <tr>
        <th>消费者姓名 :</th>
        <td><input type="text" name="customer_name" id="customer_name" class="input-text" ></td>
    </tr>
    <tr>
        <th>消费者手机号 :</th>
        <td><input type="text" name="customer_phone" id="customer_phone" class="input-text" ></td>
    </tr>
</table>
</form>
</div>
<script>
$(function(){


    $.formValidator.initConfig({formid:"info_form",autotip:true});
    $("#goods_name").formValidator({onshow:"请填写商品名称",onfocus:"请填写商品名称"}).inputValidator({min:1,onerror:"请填写商品名称"});
    $("#goods_count").formValidator({onshow:"请填写购买数量",onfocus:"请填写购买数量"}).inputValidator({min:1,onerror:"请填写购买数量"});
    $("#customer_name").formValidator({onshow:"请填写消费者姓名",onfocus:"请填写消费者姓名"}).inputValidator({min:1,onerror:"请填写消费者姓名"});
    $("#customer_phone").formValidator({onshow:"请填写消费者手机号",onfocus:"请填写消费者手机号"}).inputValidator({min:1,onerror:"请填写消费者手机号"});
    $('#info_form').ajaxForm({success:complate,dataType:'json'});
    function complate(result){
        if(result.status == 1){
            $.dialog.get(result.dialog).close();
            $.pinphp.tip({content:result.msg});
            window.location.reload();
        } else {
            $.pinphp.tip({content:result.msg, icon:'alert'});
        }
    }

})
</script>